﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RFEngine.Graphics.Fonts
{
    public sealed class CharacterInfo
    {
        #region Fields

        private int _CharID = 0;
        private float _TopTextureCoordinate = 0;
        private float _BottomTextureCoordinate = 0;
        private float _RightTextureCoordinate = 0;
        private float _LeftTextureCoordinate = 0;

        private float _XScale = 1;
        private float _YScale = 1;

        private float _Spacing = 8;

        #endregion

        #region Properties

        /// <summary>
        /// Gets the chr id this object represents
        /// </summary>
        public int CharacterID
        {
            get { return _CharID; }
        }

        /// <summary>
        /// Gets or Sets the top texture coordinate of the texture to use.
        /// </summary>
        public float TopTextureCoordinate
        {
            get { return _TopTextureCoordinate; }
            set { _TopTextureCoordinate = value; }
        }

        /// <summary>
        /// Gets or Sets the bottom texture coordinate of the texture to use.
        /// </summary>
        public float BottomTextureCoordinate
        {
            get { return _BottomTextureCoordinate; }
            set { _BottomTextureCoordinate = value; }
        }

        /// <summary>
        /// Gets or Sets the right texture coordinate of the texture to use.
        /// </summary>
        public float RightTextureCoordinate
        {
            get { return _RightTextureCoordinate; }
            set { _RightTextureCoordinate = value; }
        }

        /// <summary>
        /// Gets or Sets the left texture coordinate of the texture to use.
        /// </summary>
        public float LeftTextureCoordinate
        {
            get { return _LeftTextureCoordinate; }
            set { _LeftTextureCoordinate = value; }
        }

        /// <summary>
        /// Gets or Sets the scale of this object along the x-axis.
        /// </summary>
        public float XScale
        {
            get { return _XScale; }
            set { _XScale = value; }
        }

        /// <summary>
        /// Gets or Sets the scale of this object along the y-axis.
        /// </summary>
        public float YScale
        {
            get { return _YScale; }
            set { _YScale = value; }
        }

        /// <summary>
        /// Gets or Sets the chr spacing of this object.
        /// </summary>
        public float Spaceing
        {
            get { return _Spacing; }
            set { _Spacing = value; }
        }

        #endregion

        #region Methods

        #region Constructor(s)

        /// <summary>
        /// Constructs a new instance of this object.
        /// </summary>
        /// <param name="chr">The chr to use for this chr info</param>
        public CharacterInfo(char character) 
        { 
            _CharID = (int)character;
        }

        #endregion

        /// <summary>
        /// Method for getting the string representation of this object.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return "char_ID= " + _CharID +
                   ":\tTopTexCoord= " + TopTextureCoordinate +
                   ":\tBottomTexCoord=" + BottomTextureCoordinate +
                   ":\tLeftTexCoord=" + LeftTextureCoordinate +
                   ":\tRightTexCoord=" + RightTextureCoordinate +
                   ":\tScaleX=" + _XScale +
                   ":\tScaleY=" + _YScale +
                   ":\tSpacing=" + _Spacing + Environment.NewLine;
        }

        #endregion
    }
}
